import { createStore, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'
import { getToken } from '@/utils'
import { composeWithDevTools } from 'redux-devtools-extension'
import rootReducer from './reducers'
const middLewares = composeWithDevTools(applyMiddleware(thunk))
// const initialState = {
//   login: localStorage.getItem('geek-token'),
// }
const initialState = { login: getToken() }
const store = createStore(rootReducer, initialState, middLewares)
export default store
